<template>
    <div class="container">
        <span
            class="module stu-info"
            @click="handleRoute('list')" />
        <span
            class="module downline"
            @click="handleRoute('PlaceList')" />
        <span
            class="module task"
            @click="handleRoute('TaskList')" />
        <span
            class="module custom"
            @click="fnGoCustom()" />
    </div>
</template>

<script>
export default {
    created() {
        this.$store.commit('SET_HEADER', [{title: '首页'}]);
    },
    methods: {
        handleRoute(name) {
            this.$router.push({
                name: name
            });
        },
        fnGoCustom () {
            this.$post('/student/customer_service_zsdx%5Cget_login_session_ticket', {}, resp => {
                if (resp.code == 1) {
                    if(location.host == 'phaadmin.wxhand.com') {
                        window.open('http://css.zsdx.cn/auto-login?session_ticket=' + resp.data.session_ticket);
                    } else if (location.host == 'nadmin.wxhand.com') {
                        window.open('http://css-dev.wxhand.com/auto-login?session_ticket=' + resp.data.session_ticket);
                    } else {
                        window.open('http://css-dev.wxhand.com/auto-login?session_ticket=' + resp.data.session_ticket);
                        // window.open('http://localhost:8081/auto-login?session_ticket=' + resp.data.session_ticket);
                    }
                } else {
                    this.$message({
                        type: 'warning',
                        message: resp.msg,
                        center: true
                    });
                }
            });

        }
    }
};
</script>
<style lang="less" scoped>
.container {
    padding: 15px;
    font-size: 0;

    &>span {
        margin-bottom: 15px;
    }
}
.module {
    display: inline-block;
    width: 339px;
    height: 162px;
    margin-right: 20px;
    background-size: 100% 100%;
    cursor: pointer;
}
.downline {
    background-image: url(http://cdn.zsdx.cn/phaadmin/phadmin-2.png);
}
.stu-info {
    background-image: url(http://cdn.zsdx.cn/phaadmin/phadmin-1.png);
}
.task {
    background-image: url(http://cdn.zsdx.cn/phaadmin/phadmin-3.png);
}
.custom {
    background-image: url(http://cdn.zsdx.cn/phaadmin/phadmin-new.png);
}
</style>

